﻿using AntdUI;
using CardRegisterCollection.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.ComponentModel.Design.ObjectSelectorEditor;

namespace _9jCardRegisterCollection.Models
{
    public class CardTypeForTable : NotifyProperty
    {
        private string id;
        private string name;
        private string parentId;
        private int sort;
        private string type;
        private CardTypeForTable[] childTypes;
        private CellLink[] cellLinks;
        private string createdBy;
        private DateTime? _createdat = DateTime.Now;
        private string _lastupdatedby;
        private DateTime? _lastupdatedat = DateTime.Now;

        public DateTime CreatedAt
        {
            get => (DateTime)_createdat; set
            {
                if (_createdat == value) return;
                _createdat = value;
                OnPropertyChanged(nameof(_createdat));
            }
        }
        public string LastUpdatedBy
        {
            get => _lastupdatedby; set
            {
                if (_lastupdatedby == value) return;
                _lastupdatedby = value;
                OnPropertyChanged(nameof(_lastupdatedby));
            }
        }

        public DateTime LastUpdatedAt
        {
            get => (DateTime)_lastupdatedat; set
            {
                if (_lastupdatedat == value) return;
                _lastupdatedat = value;
                OnPropertyChanged(nameof(_lastupdatedat));
            }
        }
        public string CreatedBy
        {
            get => createdBy; set
            {
                if (createdBy == value) return;
                createdBy = value;
                OnPropertyChanged(nameof(createdBy));
            }
        }
        public CellLink[]   CellLinks
        {
            get => cellLinks; set
            {
                if (cellLinks == value) return;
                cellLinks = value;
                OnPropertyChanged(nameof(cellLinks));
            }
        }
        public CardTypeForTable[] ChildTypes
        {
            get => childTypes; set
            {
                if (childTypes == value) return;
                childTypes = value;
                OnPropertyChanged(nameof(childTypes));
            }
        }

        public string Id
        {
            get => id; set
            {
                if (id == value) return;
                id = value;
                OnPropertyChanged(nameof(id));
            }
        }

        public string Name
        {
            get => name; set
            {
                if (name == value) return;
                name = value;
                OnPropertyChanged(nameof(name));
            }
        }

        public string ParentId
        {
            get => parentId; set
            {
                if (parentId == value) return;
                parentId = value;
                OnPropertyChanged(nameof(parentId));
            }
        }
       
        public string Type
        {
            get => type; set
            {
                if (type == value) return;
                type = value;
                OnPropertyChanged(nameof(type));
            }
        }

        public int Sort { get => sort; set => sort = value; }
    }
}
